package com.gitee.zeric.tenantdb.handler;


import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author Lij
 * @since 2020-05-19
 */
public class TenantDataSourceProperties implements Serializable,Cloneable {

    private static final long serialVersionUID = 7635406453475841170L;
    /**
     * 租户id
     */
    private String tenantId;

    /**
     * 数据源url
     */
    private String datasourceUrl;

    /**
     * 数据源用户名
     */
    private String datasourceUsername;

    /**
     * 数据源密码
     */
    private String datasourcePassword;

    /**
     * 数据源驱动
     */
    private String datasourceDriver;

    /**
     * 数据源class
     */
    private String dataSourceClass;

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getDatasourceUrl() {
        return datasourceUrl;
    }

    public void setDatasourceUrl(String datasourceUrl) {
        this.datasourceUrl = datasourceUrl;
    }

    public String getDatasourceUsername() {
        return datasourceUsername;
    }

    public void setDatasourceUsername(String datasourceUsername) {
        this.datasourceUsername = datasourceUsername;
    }

    public String getDatasourcePassword() {
        return datasourcePassword;
    }

    public void setDatasourcePassword(String datasourcePassword) {
        this.datasourcePassword = datasourcePassword;
    }

    public String getDatasourceDriver() {
        return datasourceDriver;
    }

    public void setDatasourceDriver(String datasourceDriver) {
        this.datasourceDriver = datasourceDriver;
    }

    public String getDataSourceClass() {
        return dataSourceClass;
    }

    public void setDataSourceClass(String dataSourceClass) {
        this.dataSourceClass = dataSourceClass;
    }


    public TenantDataSourceProperties() {
    }

    public TenantDataSourceProperties(String tenantId, String datasourceUrl, String datasourceUsername, String datasourcePassword, String datasourceDriver, String dataSourceClass) {
        this.tenantId = tenantId;
        this.datasourceUrl = datasourceUrl;
        this.datasourceUsername = datasourceUsername;
        this.datasourcePassword = datasourcePassword;
        this.datasourceDriver = datasourceDriver;
        this.dataSourceClass = dataSourceClass;
    }

    // 深拷贝
    @Override
    public TenantDataSourceProperties clone() {
        try {
            // TODO: copy mutable state here, so the clone can't change the internals of the original
            TenantDataSourceProperties master = (TenantDataSourceProperties) super.clone();
            return master;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }
}
